<?php
if( !defined( 'IN_DISCUZ' ) ){
	exit('Access Denied');
}
if( $_GET['mid'] ){
	if( empty( $_G['master'] ) )
		showmessage( '抱歉，内容不存在。' );
	$messageLs		= C::t( 'master_message' )->fetch_all( "`a`.`mid` = '{$_GET['mid']}'", "0,5", "`updtime` DESC, `id`" );
	$workLs			= C::t( 'master_works' )->fetch_all( "`a`.`mid` = '{$_GET['mid']}'", "0,5", "`order` DESC, `id`" );
	include_once template( "master/master" );
}else{
	$_GET['page']	= $_GET['page'] ? $_GET['page'] : 1;
	$limit			= 20;
	$s_limit		= ( $_GET['page'] - 1 ) * $limit . ", {$limit}";
	$memberLs		= C::t( 'master_main' )->fetch_all( '', $s_limit, "`a`.`level` DESC, `a`.`id`" );
	$page			= multi( $memberLs['num'], $limit, $_GET['page'], "master.php" );
	
	$workLs			= C::t( 'master_works' )->fetch_all( "`logo` != '' ", '0, 6', "`b`.`level` DESC, `a`.`id` DESC" );
	include_once template( "master/index" );
}
?>